<?php
$field_arr=check_content($_POST['info']);
$id=$field_arr['id'];
$arr=array('id');
$field_arr=arr_diff($field_arr,$arr);
$field_arr=empty2zero($field_arr,array('sort'));
$field_arr['mallname']=sel_sql('mall','name','id='.$field_arr['mallid']);

if($field_arr['recommend']!=1){
	$field_arr['recommend']=0;
}
if($id=='')
{
	$field_arr['time']=date('Y-m-d H:i:s');
    insert_one_sql($table,$field_arr,0);
	admin_log('新增促销信息');
}
else
{
    update_sql($table,$field_arr,"id=$id",0,0);
	admin_log('修改促销信息');
}

echo alert('保存成功','admin.php?act=list');
?>
